set preview
set sixel true
set previewer ~/.config/lf/previewer
set cleaner ~/.config/lf/cleaner
set dircounts
set tabstop 4
set scrolloff 8
set mouse

cmd open &{{
    case $(file --mime-type -Lb -- "$(readlink -f -- "$f")") in\
        text/*|application/json|inode/x-empty|application/octet-stream)
            lf -remote "send $id \$$EDITOR '$f'"
            ;;
        image/*)
            swayimg "$f"
            ;;
        audio/*|video/*)
            mpv "$f"
            # lf -remote "send $id mpv '$f'"
            ;;
        application/x-iso9660-image)
            qemu-system-x86_64 -enable-kvm -m 2G -cdrom "$f"
            ;;
    esac
}}

cmd cb_copy &{{
    wl-copy < "$(readlink -f "$f")"
}}

cmd cb_paste &{{
    wl-paste > "$(wl-paste | sha1sum | awk '{ print $1; }').$(wl-paste | file - --extension | awk '{ print $2; }')"
}}

map a push %mkdir<space>
map D delete
map H set hidden!
map Y cb_copy
map O cb_paste
